package com.edu.app.service.impl.linkservices;

import com.edu.app.bean.core.SysRole;
import com.edu.app.bean.linkbeans.SysUserRole;

import com.edu.app.mapper.linkmappers.SysUserRoleMapper;
import com.edu.app.service.impl.SysBaseServiceImpl;
import com.edu.app.service.sys.linkservices.SysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysUserRoleServiceImpl extends SysBaseServiceImpl<SysUserRole,SysUserRoleMapper> implements SysUserRoleService {

    @Autowired
    SysUserRoleMapper sysUserRoleMapper;



    @Override
    public List<SysRole> getRoleListByUserId(Integer id){

        List<SysRole> sysRoleList = sysUserRoleMapper.getRoleListByUserId(id);
        return sysRoleList;
    }

    @Override
    public SysUserRole getUserRole(Integer user_id, Integer role_id){
        return sysUserRoleMapper.getUserRole(user_id, role_id);
    }

    @Override
    public Integer deleteUserRoleByUserId(Integer user_id){
        return sysUserRoleMapper.deleteUserRoleByUserId(user_id);
    }

    @Override
    public Integer deleteUserRoleByRoleId(Integer role_id){
        return sysUserRoleMapper.deleteUserRoleByRoleId(role_id);
    }
}
